package com.china08.yxyapi.api.manage.stu.mystudy.tifenbao.vedio;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.china08.yxyapi.api.YxyApiBaseController;
import com.china08.yxyapi.model.YxyApiRespModel;

/**
 * 先验证是否vip
 * 
 */
@CrossOrigin
@RestController
public class TifenbaoPlanWeikeIsVipController extends YxyApiBaseController {

    @RequestMapping(value = "/api_yw/manage/stu/mystudy/tifenbao/scoreimprove/weike/isvip", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public RespModel process(HttpServletRequest request, HttpServletResponse response) {

        RespModel respModel = new RespModel();
        String vipString = getProfile(request, response).getUserVip();
        Boolean userVip;
        if (vipString.equals("true")) {
            userVip = true;
        } else {
            userVip = false;
        }
        respModel.vip = userVip;
        return respModel;
    }

    /* 响应参数 */
    protected static class RespModel extends YxyApiRespModel {
        public boolean vip;// 是否为vip
    }
}
